package bma.common.langutil.concurrent;

/**
 * 定时处理任务基础类
 * 
 * @author 关中
 * @since 1.0 (imported from BMA.ESP Project)
 * 
 */
public abstract class ProcessTimerTaskAbstract implements ProcessTimerTask,
		IFace4ProcessTimerTask {

	protected long time;
	protected boolean cancel;
	protected boolean shortLived;

	public ProcessTimerTaskAbstract() {
		super();
	}

	public ProcessTimerTaskAbstract(long time) {
		super();
		this.time = time;
	}

	public ProcessTimerTaskAbstract(long time, boolean q) {
		super();
		this.time = time;
		this.shortLived = q;
	}

	@Override
	public boolean isShortLived() {
		return shortLived;
	}

	public void setShortLived(boolean shortLived) {
		this.shortLived = shortLived;
	}

	@Override
	public long getTime() {
		return time;
	}

	@Override
	public boolean isCancel() {
		return cancel;
	}

	public void setTime(long time) {
		this.time = time;
	}

	public void setCancel(boolean cancel) {
		this.cancel = cancel;
	}

	@Override
	public void cancel() {
		setCancel(true);
	}

}
